package cn.xiangyuanpin.tests;

import cn.xiangyuanpin.pojo.User;
import cn.xiangyuanpin.service.UserService;
import cn.xiangyuanpin.service.impl.UserServiceImpl;
import org.junit.Test;

import static org.junit.Assert.*;

public class UserServiceImplTest {
UserService userService=new UserServiceImpl();
    @Test
    public void registerUser() {
        userService.registerUser(new User("abcd","123456","2674997624@qq.com"));
        userService.registerUser(new User("abcde","123456","2674997624@qq.com"));
    }

    @Test
    public void login() {
       User user= new User("abcde","123456","2674997624@qq.com");

        System.out.println(  userService.login(user));
    }

    @Test
    public void existsUsername() {
        if(userService.existsUsername("admin")){
            System.out.println("用户名已存在");
        }else{
            System.out.println("用户名可用");
        }

    }
}